<%--
  Created by IntelliJ IDEA.
  User: stand
  Date: 2022/7/21
  Time: 13:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>


<html>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
<script>
    $(function (){
        $("#recharge").click(function () {
            let cardNum = $("#card_num").val();
            let  money = $("#money").val();
            $.get("recharge",{"card_num":card_num,"money":money},function (data){
                if (data=='false'){
                    alert("充值失败")
                }
                if (data=='true'){
                    flag = confirm("充值成功，是否返回登录页面？");
                    if (flag){
                        window.location.href="succeed.html"
                    }
                }
            });
        });
    });
</script>
<script src="js/jquery-3.4.1.min.js"></script>
<head>
    <title>Title</title>
</head>
<body>
<%--<form  action="recharge">--%>
<%--    选择一类卡号 <select id="card_num" name="card_num">--%>
<%--    <c:forEach items="${secondAccountNumber}" var="card">--%>
<%--        <option>${card}</option>--%>
<%--    </c:forEach>--%>
<%--</select>--%>
<%--    输入充值金额 <input type="number" name="money" id="money" >--%>
<%--    <br>--%>
<%--    <input type="submit" value="充值" id="recharge" >--%>
<%--</form>--%>




<h3>电子账户充值</h3>

<form action="recharge" method="get">
    选择二类卡号 <select id="card_num2" name="card_num2">
    <c:forEach items="${secondAccountNumber}" var="card">
        <option>${secondAccountNumber}</option>
    </c:forEach>
</select><br>

    请输入电子账户充值金额<input type="number" name="balance"><br>
    输入支付密码：<input type="password" name="paypassword" id="paypassword"><br>
    <input type="submit" value="提交">
</form>

</body>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous"></script>

</html>
